package com.mbigger.hessionclient;

import com.mbigger.hessionserver.AnotherService;
import com.mbigger.hessionserver.HessionService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.caucho.HessianProxyFactoryBean;

@Configuration
public class HessianClientConfig {
    @Bean
    public HessianProxyFactoryBean helloClient() {
        HessianProxyFactoryBean factory = new HessianProxyFactoryBean();
        factory.setServiceUrl("http://localhost:9000/hessionService");
        factory.setServiceInterface(HessionService.class);
        return factory;
    }

    @Bean
    public HessianProxyFactoryBean anotherClient() {
        HessianProxyFactoryBean factory = new HessianProxyFactoryBean();
        factory.setServiceUrl("http://localhost:9000/anotherService");
        factory.setServiceInterface(AnotherService.class);
        return factory;
    }
}
